package com.xxbb.chapter_9.dome2;

import java.io.File;
import java.util.Arrays;
import java.util.Scanner;

public class Program {
    public static void main(String[] args) {
        //Sanner读取文件
        File file = new File("int.txt");
        if (!file.exists()){
            System.out.println("文件不存在");
            return;
        }
        int array[] =new int[10];
        try (Scanner sc=new Scanner(file)){
            for (int i = 0; i < 10; i++) {
                array[i]=sc.nextInt();
            }
        }catch (Exception e){
            System.err.println(e.getMessage());
        }
        Arrays.sort(array);
        for (int element : array){
            System.out.println(element+" ");
        }
        System.out.println();

    }
}
